namespace BM.Tools.Xml.Schema
{
    using System.Xml.Schema;

    /// <summary>
    /// The factory for creating various visited objects depending on the parent, the associated schema object or the visitor.
    /// </summary>
    /// <typeparam name="TVisited">
    /// the type of the visited object
    /// </typeparam>
    public abstract class VisitedFactory<TVisited> where TVisited : class, IVisited
    {
        /// <summary>
        /// Creates the current visited object based on the data provided.
        /// </summary>
        /// <param name="parent">
        /// The parent of the currently created object.
        /// </param>
        /// <param name="schemaObject">
        /// The schema object.
        /// </param>
        /// <param name="visitor">
        /// The visitor that is used to create this visited tree.
        /// </param>
        /// <returns>
        /// the current visited object
        /// </returns>
        public abstract TVisited Create(TVisited parent, XmlSchemaObject schemaObject, Visitor<TVisited> visitor);        
    }
}